| 1. | The double checking lock initialization code should look like this example 检查锁初始化代码应类似下面的示例: |
| 2. | Double - checked locking problem 双重检查锁定问题 |
| 3. | Check lock lever 校核锁闭握柄 |
| 4. | If you ve read any of the articles on the double - checked locking problem see 如果您阅读了关于双重检查锁定问题( double - checked locking problem )的任何文章(参阅 |
| 5. | Under the new memory model , this " fix " to double - checked locking renders the idiom thread - safe 在新的内存模型中,对双重检查锁定的这个“修复”使idiom线程安全。 |
| 6. | For a description of the double - checked locking problem and an an explanation of why the proposed algorithmic fixes don t work (有关双重检查锁定的问题和对为什么所建议的算法修复不能解决问题的说明请参阅 |
| 7. | Allow one of the commonly proposed alternatives to double - checked locking to work correctly , although the technique is still discouraged 的新语义允许通常所提出的其中一个双重检查锁定的可选方法正确地工作,尽管我们不鼓励这种技术。 |
| 8. | One of the proposed fixes to the double - checked locking problem was to make the field that holds the lazily initialized instance a volatile field 对双重检查锁定问题提出的一种修复是使包含迟缓初始化的实例的字段为一个volatile字段。 |
| 9. | So if the goal of double - checked locking is supposed to offer improved performance over a more straightforward synchronized approach , this " fixed " version doesn t help very much either )所以如果双重检查锁定的目标是提供比更直观的同步方式更好的性能,那么这个“修复的”版本也没有多大帮助。 |
| 10. | Instead of double - checked locking , use the initialize - on - demand holder class idiom , which provides lazy initialization , is thread - safe , and is faster and less confusing than double - checked locking 不使用双重检查锁定,而使用initialize - on - demand holder class idiom ,它提供了迟缓初始化,是线程安全的,而且比双重检查锁定更快且没那么混乱: |